<?php
declare (strict_types = 1);

namespace app\admin\controller;
use think\facade\Db;
use think\facade\Request;
use think\facade\View;

class goodCate {
    public function cate()
    {

        $list=Db::table('ecm_gcategory')->field('parent_id')->select();
        $abc=[];
        foreach ($list as $v) {
            $abc[]=$v['parent_id'];
        }
        $a=Request::get('cid');
        if(empty($a)){
          $rt=Db::table('ecm_gcategory')->where('parent_id','=',0)
          ->order('sort_order desc')->select();
        }else{
            $rt=Db::table('ecm_gcategory')->where('parent_id','=',$a)
          ->order('sort_order desc')->select();
        }
        View::assign("list",$abc);
        View::assign('rt',$rt);
        return View::fetch();

    }

    public function cateedit(){
        return View::fetch();
    }


}